package servlet;

import data.CountLogData;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "LogBarChartServlet")
public class LogBarChartServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.setHeader("Content-Type", "text/html");
        response.setCharacterEncoding("UTF-8");
        CountLogData countLogData = new CountLogData();
        String responseText = countLogData.countData();
        PrintWriter printWriter = response.getWriter();
        printWriter.print(responseText);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        doPost(request, response);
    }
}
